Run your agent in the emu-tool

This procedure picks up where you left off in the open terminal window in which you installed emu-tool and created a simulated meter (Install emu-tool and create a simulated meter).

When your agent is ready to test, even immediately after cloning the ThirdPartyReferenceAgent, you can run your agent in the emu-tool.

  1. Run the command

    Copy
    sudo ./build.sh
  2. Run the command

    Copy
    sudo ./pack.sh
  3. Locate your unsigned agent .zip file with the command

    Copy
    ls ../../build/<AgentName>/Release/

    ...where <AgentName> is the name of your agent. In our example, the agent name is MyNewAgent.

    Take note of the .zip file name because you will use it later in this procedure.

  4. View all your options using the command

    Copy
    emu-tool

    All the emu-tool options are displayed in your terminal window.

  5. Create your simulated meter using the command

    Copy
    emu-tool create-<meter hardware> <meterName>

    ...where <meter hardware> is the specific meter hardware version for which you are developing your agent. In our example, the meter hardware is hw42.

    The meter files that are loaded into your emulated meter differ by meter hardware version. Be sure to create the correct simulated meter hardware for which you are developing your agent. For more information, see insert link here.

    ...and where <meterName> is the name you want to give your simulated meter. In our example, the meter name is m1.

  6. Check that the meter was created using the command

    Copy
    emu-tool ls

    The result looks similar to the following image. Note the meter is listed so you can verify its name. The meter state is stopped.

  7. Install the the agent onto the meter using the command

    Copy
    emu-tool agent-install <fileLocation/filename.zip> <meterName>

    ...where <fileLocation/filename.zip> is the directory location of the meter.

    ...and where <meterName> is the name of the meter.

  8. If you have a configuration file you can load it now using the command

    Copy
    emu-tool agent-config <fileLocation/filename.zip> <meterName>

    ...where <fileLocation/filename.zip> is the directory path to your .zip file.

    ...and where <meterName> is your meter name. In the example, the meter name is m1.

  9. If you have a dataset you can load it now using the command

    Copy
    emu-tool agent-install <fileLocation/filename.zip> <meterName>

    ...where <fileLocation/filename.zip> is the directory path to your .zip file.

    ...and where <meterName> is your meter name. In the example, the meter name is m1.

  10. If you want to load files into flash for testing you can do so now. Loading files into flash for testing is useful for agents that save and use data in flash. You can test power outages, test different agent versions from the same flash data, or retest agents from the same starting point. Load files into flash using the command

    Copy
    emu-tool flash-unzip <meterName>

    ...where <meterName> is the name of your meter.

    Now that your agent is running in the emu-tool, you can start the meter and attach into it.

  11. Go to the next procedure, Start your meter, start and stop your agent, attach into the meter container, and view your meter logs.